<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "tb_course".
 *
 * @property integer $course_id
 * @property integer $user_id
 * @property string $teacher_ids
 * @property string $teacher_names
 * @property string $name
 * @property string $small_name
 * @property integer $type
 * @property string $price
 * @property string $costPrice
 * @property string $contentPC
 * @property string $contentWAP
 * @property string $about
 * @property integer $sectionTotal
 * @property string $lessonTime
 * @property integer $sharpPionts
 * @property integer $getPionts
 * @property string $createTime
 * @property string $releaseTime
 * @property string $smallImg
 * @property string $middleImg
 * @property integer $demo
 * @property integer $demoTime
 * @property string $videoURL
 * @property integer $praiseNum
 * @property integer $praise
 * @property integer $collectionNum
 * @property integer $collection
 * @property integer $level
 * @property integer $status
 * @property integer $teachingForm
 * @property integer $maxStudentNum
 * @property string $audiences
 * @property string $goals
 * @property integer $recommended
 * @property integer $totalSales
 * @property string $recentTime
 * @property integer $registered
 * @property integer $learned
 * @property string $bigImg
 * @property integer $playvideo
 * @property string $owner_id
 * @property string $auth_code
 * @property integer $adverted
 * @property string $extension_id
 * @property string $valid
 * @property string $zhangjie_title
 * @property string $zhangjie_content
 * @property integer $read_num
 * @property string $course_attr
 * @property string $activity
 * @property string $iscoupon
 * @property integer $custom_sales
 * @property string $new_chang_img
 * @property string $new_kuai_img
 * @property integer $luping_id
 * @property string $m_index_show
 * @property string $m_lunbo_img01
 * @property string $m_lunbo_img02
 * @property string $m_lunbo_img03
 * @property integer $channel
 */
class TbCourse extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'tb_course';
    }

    /**
     * @return \yii\db\Connection the database connection used by this AR class.
     */
    public static function getDb()
    {
        return Yii::$app->get('passportdb');
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['user_id', 'teacher_ids', 'teacher_names', 'name', 'small_name', 'type', 'price', 'costPrice', 'contentPC', 'contentWAP', 'about', 'sectionTotal', 'lessonTime', 'sharpPionts', 'createTime', 'releaseTime', 'smallImg', 'middleImg', 'demo', 'demoTime', 'videoURL', 'praiseNum', 'praise', 'collectionNum', 'collection', 'level', 'teachingForm', 'maxStudentNum', 'audiences', 'goals', 'totalSales', 'recentTime', 'registered', 'learned', 'bigImg', 'playvideo', 'owner_id', 'auth_code', 'adverted', 'extension_id', 'zhangjie_title', 'zhangjie_content', 'read_num', 'course_attr', 'iscoupon', 'custom_sales', 'new_chang_img', 'new_kuai_img', 'm_lunbo_img01', 'm_lunbo_img02', 'm_lunbo_img03'], 'required'],
            [['user_id', 'type', 'sectionTotal', 'sharpPionts', 'getPionts', 'demo', 'demoTime', 'praiseNum', 'praise', 'collectionNum', 'collection', 'level', 'status', 'teachingForm', 'maxStudentNum', 'recommended', 'totalSales', 'registered', 'learned', 'playvideo', 'adverted', 'read_num', 'custom_sales', 'luping_id', 'channel'], 'integer'],
            [['teacher_names', 'contentPC', 'contentWAP', 'about', 'zhangjie_content', 'course_attr', 'activity', 'iscoupon', 'm_index_show'], 'string'],
            [['price', 'costPrice', 'lessonTime'], 'number'],
            [['createTime', 'releaseTime', 'recentTime'], 'safe'],
            [['teacher_ids'], 'string', 'max' => 128],
            [['name'], 'string', 'max' => 50],
            [['small_name', 'smallImg', 'middleImg', 'videoURL', 'audiences', 'goals', 'bigImg'], 'string', 'max' => 100],
            [['owner_id'], 'string', 'max' => 32],
            [['auth_code'], 'string', 'max' => 11],
            [['extension_id'], 'string', 'max' => 10],
            [['valid', 'zhangjie_title'], 'string', 'max' => 20],
            [['new_chang_img', 'new_kuai_img', 'm_lunbo_img01', 'm_lunbo_img02', 'm_lunbo_img03'], 'string', 'max' => 200],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'course_id' => 'Course ID',
            'user_id' => 'User ID',
            'teacher_ids' => 'Teacher Ids',
            'teacher_names' => 'Teacher Names',
            'name' => 'Name',
            'small_name' => 'Small Name',
            'type' => 'Type',
            'price' => 'Price',
            'costPrice' => 'Cost Price',
            'contentPC' => 'Content Pc',
            'contentWAP' => 'Content Wap',
            'about' => 'About',
            'sectionTotal' => 'Section Total',
            'lessonTime' => 'Lesson Time',
            'sharpPionts' => 'Sharp Pionts',
            'getPionts' => 'Get Pionts',
            'createTime' => 'Create Time',
            'releaseTime' => 'Release Time',
            'smallImg' => 'Small Img',
            'middleImg' => 'Middle Img',
            'demo' => 'Demo',
            'demoTime' => 'Demo Time',
            'videoURL' => 'Video Url',
            'praiseNum' => 'Praise Num',
            'praise' => 'Praise',
            'collectionNum' => 'Collection Num',
            'collection' => 'Collection',
            'level' => 'Level',
            'status' => 'Status',
            'teachingForm' => 'Teaching Form',
            'maxStudentNum' => 'Max Student Num',
            'audiences' => 'Audiences',
            'goals' => 'Goals',
            'recommended' => 'Recommended',
            'totalSales' => 'Total Sales',
            'recentTime' => 'Recent Time',
            'registered' => 'Registered',
            'learned' => 'Learned',
            'bigImg' => 'Big Img',
            'playvideo' => 'Playvideo',
            'owner_id' => 'Owner ID',
            'auth_code' => 'Auth Code',
            'adverted' => 'Adverted',
            'extension_id' => 'Extension ID',
            'valid' => 'Valid',
            'zhangjie_title' => 'Zhangjie Title',
            'zhangjie_content' => 'Zhangjie Content',
            'read_num' => 'Read Num',
            'course_attr' => 'Course Attr',
            'activity' => 'Activity',
            'iscoupon' => 'Iscoupon',
            'custom_sales' => 'Custom Sales',
            'new_chang_img' => 'New Chang Img',
            'new_kuai_img' => 'New Kuai Img',
            'luping_id' => 'Luping ID',
            'm_index_show' => 'M Index Show',
            'm_lunbo_img01' => 'M Lunbo Img01',
            'm_lunbo_img02' => 'M Lunbo Img02',
            'm_lunbo_img03' => 'M Lunbo Img03',
            'channel' => 'Channel',
        ];
    }
}
